import axios from 'axios'

// let base = 'http://ads.bestproperty.com.mm'
// let base = 'http://adstest.dlintech.com'
// let base = '/api'
// let base = 'http://10.7.18.20:8085'
let base = '';

// 手机验证码登录
export const loginUser = params => { return axios.post(`${base}/app/user/login-sms`, params) }
// Google 登录
export const loginWithGoogle = params => { return axios.post(`${base}/app/user/login/google`, params) }
// FaceBook 登录
export const loginWithFaceBook = params => { return axios.post(`${base}/app/user/login/facebook`, params) }
// 发送sms校验码
export const sendSmsUser = params => { return axios.post(`${base}/send-checkmobi-sms`, params) }
// 注册
export const registerUser = params => { return axios.post(`${base}/app/user/register`, params) }
// 退出登录
export const signOutUser = params => { return axios.post(`${base}/app/user/sign-out`, params) }

// 用户名密码登录
export const loginWithPassAndUserName = params => { return axios.post(`${base}/app/user/login-password-name`, params) }
//邮箱注册
export const registerUserWithEmail = params => { return axios.post(`${base}/app/user/send-email-register`, params) }
//google注册
export const registerWithGoogle = params => { return axios.post(`${base}/app/user/register/google`, params) }
//Facebook 注册
export const registerWithFaceBook = params => { return axios.post(`${base}/app/user/register/facebook`, params) }
// 忘记密码 -- 通过手机重置密码
export const resetPassword = params => { return axios.post(`${base}/app/user/user/forget-password-sms`, params) }
// 忘记密码 -- 通过手邮箱重置密码
export const forgotEmailPassword = params => { return axios.post(`${base}/app/user/send-forget-password-email`, params) }
// 邮箱点击收到的链接后 -- 重置密码
export const resetEmailPassword = params => { return axios.post(`${base}/app/user/update-password`, params) }

// new development Form 提交时 Units and Price 组件的图片上传
export const uploadFloorImgAjax = (params, config) => { return axios.post(`${base}/manage/uploadfile/beforehand/photo`, params, config) }
// new development Form 提交时 Units and Price 组件图片上传后，提交用户基本信息
export const uploadDevelopmentInfo = (params, config) => { return axios.post(`${base}/manage/development`, params, config) }
// new development Form 提交时 提交主图
export const uploadDevelopmentPhotos = (params, config) => { return axios.post(`${base}/manage/development/photos`, params, config) }
// new development Form 提交时 用户基本信息提交后，上传development photos
// export const uploadDevelopmentFloorPhotos = (params, config) => { return axios.post(`${base}/manage/development/floorplan/photos`, params, config) }
export const uploadDevelopmentFloorPhotos = (params, config) => { return axios.post(`${base}/manage/development/photos`, params, config) }
//development 编辑
export const initDevelopment = (params) => { return axios.get(`${base}/manage/development/` + params) }
export const updateDevelopmentInfo = (params, config) => { return axios.post(`${base}/manage/development/update`, params, config) }


// new Agent Form 提交时 提交主图
export const uploadAgentPhotos = (params, config) => { return axios.post(`${base}/manage/uploadfile/beforehand/photo`, params, config) }
// new Agent Form 提交时 提交表单信息
export const uploadAgentInfo = (params, config) => { return axios.post(`${base}/manage/transaction`, params, config) }
// new Agent Form 提交时 用户基本信息提交后 上传photos
export const uploadAgentFormPhotos = (params, config) => { return axios.post(`${base}/manage/transaction/photos`, params, config) }
//Agent 编辑
export const initAgent = (params) => { return axios.get(`${base}/manage/transaction/` + params) }
export const updateAgentInfo = (params, config) => { return axios.post(`${base}/manage/transaction/update`, params, config) }


//Facebook SMS注册
export const registerWithFaceBookSMS = params => { return axios.post(`${base}/app/user/register`, params) }
//Facebook SMS 登录
export const loginWithFaceBookSMS = params => { return axios.post(`${base}/app/user/login-facebook-sms`, params) }

// 账号密码登录
export const loginWithPassAndName = params => { return axios.post(`${base}/app/user/login-password`, params) }
export const setUserInfoPhone = params => { return axios.post(`${base}/app/user/user/phone-reset`, params) }
